from kafka import KafkaConsumer
import json

consumer = KafkaConsumer('topic-test',group_id='test',bootstrap_servers=['81.70.199.153:9092'])
for msg in consumer:
    recv = "%s:%d:%d: key=%s value=%s" % (msg.topic, msg.partition, msg.offset, msg.key, msg.value)
    print(recv)
    print(type(recv))
    print("接收成功")

